<?php
session_start();

include_once("../../Misc.php");
include_once("../../classCol/UID.php");
include_once("../../classCol/classOracleDb.php");
include_once("../models/fetchers.php");
include_once("../../helpers/CHtml.php");
include_once("../../helpers/Composer.php");
include_once("../../helpers/ComposerSourceDb.php");
include_once("../../models/GFetchers.php");

$CFetchers  = new CGFetchers;

$SourceDb   = new Composer;
$SourceDb   = $SourceDb->init("db");

$SourceDb->add("srcDbHdr",      "MUT_WHS_HDR");
$SourceDb->add("srcDbDtl",      "MUT_WHS_DTL");
$SourceDb->add("srcDbMstWhs",   "MST_WAREHOUSE");

$Db = new oracleDb;
$Db->init($_SESSION["ORCL"],
           $_SESSION["OPASS"],
           $_SESSION["SID"],
           _NO_COMMENT);

if($Db->connect()){

  $CFetchers->fetchLstWhs($Db,
                          $SourceDb->fetchValue("srcDbMstWhs"),
                          $nWhs,
                          $lstWhs);

  CGHtml::initDropDownContent($lstWhs,
                              $_POST["whs"],
                              $retContent);

  echo  $retContent;

  $Db->dc();
}else{

  echo  _CONN_ERROR;
}

?>